package com.blackitheima1.InnerDemo.test5;
//匿名内部类
public class TestInner {
    public static void main(String[] args) {
        //创建实现类对象
        System.out.println("创建实现类对象:");
        InterImple in=new InterImple();
        in.show();
        in.show1();
        in.show2();
        //单实现匿名内部类
        new Inter(){

            @Override
            public void show() {
                System.out.println("----单实现匿名内部类");
            }
        }.show();
        //多实现匿名内部类
        System.out.println("多实现匿名内部类");
        Inter1 i=new Inter1(){

            @Override
            public void show() {
                System.out.println("*******");
            }

            @Override
            public void show1() {
                System.out.println("&&&&&&&&");
            }

            @Override
            public void show2() {
                System.out.println("@@@@@@@@@");
            }
        };
        i.show();
        i.show1();
        i.show2();

    }
}
//接口
interface Inter{
    public abstract void show();
}
//接口继承
interface Inter1 extends Inter{
    @Override
    void show();
    public abstract void show1();
    public abstract void show2();
}
//实现类
class InterImple implements Inter,Inter1{

    @Override
    public void show() {
        System.out.println("---");
    }

    @Override
    public void show1() {
        System.out.println("+++++");
    }

    @Override
    public void show2() {
        System.out.println("=======");
    }
}